home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / comm / mail / YamNet.lha / FSCode.lha / Rexx / Spot / UUDecode.spot < prev    next >
Text File  |  1995-03-12  |  2KB  |  68 lines

  1. /* UUDecode.spot written by François Helsen           */
  2. /* Thanks to David Nouls and Alex Van Boxel           */
  3. /*         for their inspiration                      */
  4. /* Install as 'UUDecode...' in the ARexx menu.        */
  5. /* $VER: UUDecode.spot 1.8MA (18.3.94)                */
  6. /* Again modified by David Nouls                      */
  7. /* Addedd FSCode support by Marco Amadori 2:333/408.9 */
  8.  
  9. address spot
  10. options results
  11.  
  12. 'ismessages'
  13. if rc = 5 then do
  14.    'requestnotify "Use in message window only!"'
  15.    exit
  16.    end
  17.  
  18. cmd.n       = 2                          /* Number of Decoder */
  19.  
  20. cmd.1       = 'C:UUOut'                  /* Full path to command UUDecode or similar */
  21. cmd.2       = 'C:FSCode'                 /* Full path to command FSCode */
  22.  
  23. cmd.bgn.1   = 'begin'                    /* Start word for UUDecode */
  24. cmd.bgn.2   = '!start'                   /* Start word for FSCode */
  25.  
  26. defpath     = 'RAM:'
  27. work        = 'T:'
  28.  
  29. call AddLib('rexxsupport.library',0,-30,0)
  30.  
  31. saveascii work'spotuu.temp' overwrite
  32.  
  33. if Open(in,work'spotuu.temp','r') then do
  34.    do until eof(in)
  35.       parola = word(readln(in),1)
  36.       do c = 1 to 2
  37.          if parola = cmd.bgn.c then do
  38.             k = c
  39.             break
  40.          end
  41.       end
  42.    end
  43.    call Close(in)
  44.    if k >= 1 then do
  45.       'requestpath title "Pick a directory" path 'defpath
  46.       if rc = 0 then do
  47.          dirname = result
  48.          olddir = pragma('d', dirname)
  49.          ADDRESS COMMAND cmd.k work'spotuu.temp'
  50.          call pragma('d', olddir)
  51.          'requestnotify "File decoded..."'
  52.          end
  53.       end
  54.    
  55.    else do
  56.       'requestnotify "This message does not contain UU/FS Encoded Data"'
  57.       end
  58.    call Delete(work'spotuu.temp')
  59.    end
  60.  
  61. exit /* done here */
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.